Assessment of exposure to drug use and psychosocial stress is complicated by the fact that each is often transient and difficult to recall accurately. Assessment of their causal connections with one another, and of their genetic and environmental determinants, is complicated by the complexity of the causal connections and by the elusive nature of what constitutes the environment. In this project, we are assessing drug use and psychosocial stress in near-real time through Ecological Momentary Assessment (EMA), in which participants use handheld electronic diaries to record events as they occur and to report recent or ongoing events in response to randomly timed prompts throughout the day. We are also maintaining real-time records of where the reported events occurred by having participants carry Global Positioning System (GPS) devices to track their whereabouts with a spatial resolution of several meters. These data are being used collectively in a method we are calling Geographical Momentary Assessment (GMA), described further below. Analyses of EMA data in our population of polydrug users in treatment have shown that negative affect (stress), celebratory states, and drug cues are associated with subsequent cocaine use. Exposure to legal drugs, such as tobacco, is also strongly linked to cocaine use as well as cocaine craving. The likelihood of smoking tobacco at a given moment increased linearly with the current severity of cocaine craving (or dual craving for heroin and cocaine). The likelihood of tobacco smoking during episodes of use of cocaine (or cocaine and heroin), was greater still. This association remained significant after we controlled for demographic variables, location, and mood. These findings have implications for exposure to stress and illicit drugs and will be incorporated into our algorithms for risk-exposure assessment. We have also investigated the concomitants of urine-verified periods of cocaine use and abstinence. In a cohort design, a volunteer sample of 112 methadone-maintained cocaine- and heroin-abusing outpatients provided EMA data on handheld computers for 10,781 person-days. EMA responses to questions about current location, activities, companions, moods, and recent exposure to putative drug-use triggers were compared across periods of use and abstinence. Periods of cocaine use were associated with idle, solitary, affectively negative afternoons, but, unexpectedly, were also associated with a greater likelihood of early-morning or late-evening work. The whole-day concomitants of cocaine use were often distinct from the acute predecessors of use seen in prior analyses from the same sample. Several measures of negative mood increased during abstinence. Weeks of cocaine use and abstinence in outpatients are associated with distinct patterns of mood and behavior;the detailed hourly data reported here should help inform treatment interventions aimed at changing daily activities. Data from this study were also used to investigate the relationship between craving and drug use in real time and in the daily living environments of drug users. Craving is often assumed to cause ongoing drug use and relapse and is a major focus of addiction research. However, its relationship to drug use has not been adequately documented. Participants rated their craving and mood at random times (two to five times daily, prompted by electronic diaries) as they went about their everyday activities. They also initiated an electronic-diary entry each time they used cocaine. Drug use was monitored by thrice-weekly urine testing. During periods of urine-verified cocaine use, ratings of cocaine craving increased across the day and were higher than during periods of urine-verified abstinence. During the five hours prior to cocaine use, ratings of craving significantly increased. These patterns were not seen in ratings of heroin craving or mood (e.g., feeling happy or bored). Cocaine craving is tightly coupled to cocaine use in users normal environments. Our findings provide previously unavailable support for a relationship that has been seriously questioned in some theoretical accounts. Broadening the definition of environmental factors, we are using GMA, which incorporates continuous geolocation tracking, to evaluate neighborhood-level effects measured in terms of specially developed indices, such as the Neighborhood Psychosocial Hazards index (NPH), based on objective statistical data available from public sources and independent of self-report, plus the NIfETy, based on objective environmental ratings by trained observers. For comparison, we are also assessing drug exposure through retrospective interviews and from biological specimens (urine), and assessing stress through physiological measures (allostatic load). The result is expected to be a set of field-deployable, state-of-the-art tools indispensable to future studies of gene-environment interactions affecting drug use and stress. We have completed an initial pilot study to identify the appropriate GPS equipment and location sampling strategy and a developmental trial with 29 participants who carried the electronic diaries and GPS units for approximately 100 days. We are analyzing the real-time location data and combining it with EMA data and urine drug screen results for a completed GMA pilot study. We have also been developing measures of environmental risk based on publicly available databases and NIfETy data as part of risk exposure algorithm development. We are currently conducting a larger trial incorporating additional stress measures.